package cn.rkylin.oms.item.dao;

import cn.rkylin.core.IDataBaseFactory;
import cn.rkylin.oms.item.domain.SkuGroup;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

@Repository(value = "ecSkuGroupDAO")
public class EcSkuGroupDAOImpl implements IEcSkuGroupDAO {

    @Autowired
    protected IDataBaseFactory dao;

    /**
     * 构造函数
     */
    public EcSkuGroupDAOImpl() {

    }

    @Override
    public int insert(SkuGroup ecSkuGroup) throws Exception {
        return dao.insert("insertSelectiveEcSkuGroup", ecSkuGroup);
    }

    @Override
    public int update(SkuGroup ecSkuGroup) throws Exception {
        return dao.update("updateByPrimaryKeySelectiveEcSkuGroup", ecSkuGroup);
    }

    /**
     * 逻辑删除组合商品
     *
     * @param ecSkuGroup
     * @return
     * @throws Exception
     */
    @Override
    public int updateEcSkuGroupByEcSkuId(SkuGroup ecSkuGroup) throws Exception {
        return dao.update("updateEcSkuGroupByEcSkuId", ecSkuGroup);
    }

}
